﻿<Window x:Class="ResourceBlender_Express.WinResourcesGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    loc:WindowService.EscapeClosesWindow="True"
    Title="View Resources" WindowStartupLocation="CenterOwner"
    MinHeight="400" Height="470" MinWidth="400" Width="800"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlender-Express;component/Resources/images/resourceblender.ico">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseWindow" />
        <CommandBinding Command="ApplicationCommands.New" Executed="AddElement" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Edit" Executed="EditElement" CanExecute="CanExecuteEditElement" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Delete" Executed="DeleteElement" CanExecute="CanExecuteDeleteElement" />
    </Window.CommandBindings>
    <Window.Resources>
        <Image x:Key="AddElement_16" Source="pack://application:,,,/Resources/images/doc_add_16.png" />
        <Image x:Key="EditElement_16" Source="pack://application:,,,/Resources/images/doc_edit_16.png" />
        <Image x:Key="DeleteElement_16" Source="pack://application:,,,/Resources/images/doc_delete_16.png" />
    </Window.Resources>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="_File">
                <MenuItem Header="E_xit" Command="ApplicationCommands.Close" />
            </MenuItem>
            <MenuItem Header="_Element">
                <MenuItem Header="_New Element" Icon="{StaticResource AddElement_16}" Command="ApplicationCommands.New" />
                <MenuItem Header="_Edit Element" Icon="{StaticResource EditElement_16}" Command="loc:ResourceBlenderCommands.Edit" />
                <MenuItem Header="_Delete Element"  Icon="{StaticResource DeleteElement_16}" Command="loc:ResourceBlenderCommands.Delete" />
                <!--Separator />
                <MenuItem Header="Find elements which use the same resource/rephrase this"  Icon="{StaticResource DeleteElement_16}" Command="loc:ResourceBlenderCommands.Delete" /-->
            </MenuItem>
        </Menu>
        <StatusBar DockPanel.Dock="Bottom" Height="24">
            <StatusBarItem x:Name="lblStatus" Visibility="Hidden">Loading</StatusBarItem>
            <StatusBarItem>
                <ProgressBar x:Name="prgStatus" IsIndeterminate="True" />
            </StatusBarItem>
        </StatusBar>
        <ToolBar DockPanel.Dock="Top" Height="58">
            <loc:ImageButton x:Name="btnAdd" Command="ApplicationCommands.New" Text="Add" Image="Resources/images/add_24.png" ToolTip="Add Element" Style="{StaticResource ToolBarButton}" />
            <loc:ImageButton x:Name="btnEdit" Command="loc:ResourceBlenderCommands.Edit" Text="Edit" Image="Resources/images/edit_24.png" ToolTip="Edit Element" Style="{StaticResource ToolBarButton}" />
            <loc:ImageButton x:Name="btnDelete" Command="loc:ResourceBlenderCommands.Delete" Text="Delete" Image="Resources/images/delete_24.png" ToolTip="Delete Element" Style="{StaticResource ToolBarButton}" />
        </ToolBar>
        <Grid DockPanel.Dock="Top" Margin="6">
            <ListView x:Name="lstGrid" ItemsSource="{Binding}" MouseDoubleClick="lstGrid_MouseDoubleClick" AlternationCount="3">
                <ListView.View>
                    <GridView x:Name="grdResources">
                        <GridViewColumn Header="Bundle" DisplayMemberBinding="{Binding Path=bundlename}" CellTemplate="{StaticResource CommentAsToolTipTemplate}" />
                        <GridViewColumn Header="Element" DisplayMemberBinding="{Binding Path=elementname}" CellTemplate="{StaticResource CommentAsToolTipTemplate}" />
                    </GridView>
                </ListView.View>
                <ListView.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="_New Element" Icon="{StaticResource AddElement_16}" Command="ApplicationCommands.New" />
                        <MenuItem Header="_Edit" Icon="{StaticResource EditElement_16}" Command="loc:ResourceBlenderCommands.Edit" />
                        <MenuItem Header="_Delete"  Icon="{StaticResource DeleteElement_16}" Command="loc:ResourceBlenderCommands.Delete" />
                    </ContextMenu>
                </ListView.ContextMenu>
            </ListView>
        </Grid>
    </DockPanel>
</Window>
